package game.controller;

import javafx.scene.canvas.GraphicsContext;
import javafx.scene.image.Image;

import static game.basic.GameBase.*;
import static game.basic.Util.getImage;
import static game.main.GameApp.player;

public class Supplies extends GameObject {


    public Image objImg;

    public boolean collision = false;//是否为实体  默认为否可以通过,同时可拾取

    public String description = "";//物品描述

    public int attackValue;//伤害值

    public int defenseValue;//防御值


    public void readObjImage(String url, int width, int height) {
        objImg = getImage(url, width, height);
    }

    @Override
    public void draw(GraphicsContext gc) {
        if ((worldX) + tileSize > player.worldX - screenX &&
                (worldX) - tileSize < player.worldX + screenX &&
                (worldY) + tileSize > player.worldY - screenY &&
                (worldY) - tileSize < player.worldY + screenY) {
            gc.drawImage(objImg,
                    (worldX) - player.worldX + screenX,
                    (worldY) - player.worldY + screenY);
        }
    }

    public void use() {
    }
}
